let name = ''
let phone = ''
let address = ''
let area = ''
Page({
  data:{

  },
  onLoad()
  {
    let message = wx.getStorageSync('message')
    console.log(message.length)
    if(message.length == 0)
    {
      console.log("没有信息")
    }
    else
    {
      let name = message[0]
      let phone = message[1]
      let area = message[2]
      let address = message[3]
      this.setData({
        name:name,
        phone:phone,
        area:area,
        address:address
      })
    }
  },
  name(e)
  {
    name = e.detail.value
  },
  phone(e)
  {
    phone = e.detail.value
  },
  address(e)
  {
    address = e.detail.value
  },
  area(e)
  {
    area = e.detail.value
  },
  confirm()
  {
    let message = [name,phone,area,address]
    console.log(message)
    wx.setStorageSync('message', message)
    message = wx.getStorageSync('message')
    console.log(message)
    wx.showToast({
      title: '保存成功',
      icon: 'success',
      duration: 2000
     })
  }
})